package com.uzai.console.enums;

/**
 * 个人设备产品模块KEY
 */
public enum DeviceProductEnum {

    /**
     * 全部
     */
    ALL("all","套餐(返利+朋友圈+悠聊)", "['pyq','fl','uzaichat']"),

    /**
     * 返利
     */
    FL("fl","返利", "['fl']"),

    /**
     * 朋友圈
     */
    PYQ("pyq","朋友圈", "['pyq']"),

    /**
     * 悠聊
     */
    UZAICHAT("uzaichat","悠聊", "['uzaichat']"),

    /**
     * 封号转名片
     */
    BANTRANSFER("bantransfer","转发名片", "['bantransfer']"),

    /**
     * 社群群发功能
     */
    FD("fd","社群群发", "['fd']"),

    /**
     * 气氛组
     */
    TUO("tuo","气氛组(托)", "['tuo']"),


    ;

    private String value;   //产品key
    private String desc;    //产品名称
    private String codes;   //关联的产品

    DeviceProductEnum(String value, String desc, String codes) {
        this.value = value;
        this.desc = desc;
        this.codes = codes;
    }

    public String getValue() {
        return value;
    }
    public String getDesc() {
        return desc;
    }
    public String getCodes() { return codes; }

    public static DeviceProductEnum getValue(String value) {
        if (value == null) {
            return null;
        }
        for (DeviceProductEnum type: DeviceProductEnum.values()) {
            if (type.getValue().equals(value) ) {
                return type;
            }
        }
        return null;
    }
    public static String getDesc(String value) {
        if(getValue(value) == null){
            return null;
        }
        return getValue(value).getDesc();
    }
    public static String getCodes(String value) {
        if(getValue(value) == null){
            return null;
        }
        return getValue(value).codes;
    }

}
